package il.ac.bgu.cs.heuristics.integration;

import javaff.planning.FFState;
import javaff.planning.NullFilter;
import javaff.search.BreadthFirstSearch;

public class BreadthFirstSearchAdapter implements ISearchAlgorithm<FFState>,
		INodeCounter {

	private int	lastSearchNodeCount;

	@Override
	public FFState search(FFState initial) {
		BreadthFirstSearch bfs = new BreadthFirstSearch(initial);
		bfs.setFilter(NullFilter.getInstance());
		FFState state = bfs.search();
		lastSearchNodeCount = bfs.getNodeCount();
		return state;
	}

	@Override
	public int getNodeCount() {
		return lastSearchNodeCount;
	}

}
